home *** CD-ROM | disk | FTP | other *** search
/ The Very Best of Atari Inside / The Very Best of Atari Inside 1.iso / mint / mntlib43 / mntlib / perror.c < prev    next >
C/C++ Source or Header  |  1992-09-05  |  350b  |  23 lines

  1. /* originally from Dale Schumacher's dLibs */
  2.  
  3. /*
  4.  * standard "print error message" function
  5.  */
  6.  
  7. #include <stdio.h>
  8. #include <errno.h>
  9. #include <string.h>
  10.  
  11. void perror(msg)
  12.     const char *msg;
  13.     {
  14.     if(msg && *msg)
  15.         {
  16.         fputs(msg, stderr);
  17.         fputs(": ", stderr);
  18.         }
  19.     if((msg = strerror(errno)) != NULL)
  20.         fputs(msg, stderr);
  21.     fputs(".\n", stderr);
  22.     }
  23.